﻿<%@ Page Language="C#" MasterPageFile="~/Design/MasterPage/MasterPage.master" AutoEventWireup="true"
    CodeFile="MonitorDetail.aspx.cs" Inherits="App_Search_MonitorDetail" Title="监控画面" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<Script language="JavaScript">
var PlayerCount;
var playId;
var playChannel;
    var pOnloadFunc = function() {
        document.body.detachEvent("onload", pOnloadFunc);

        var NetClientX = document.getElementById("NetClientX");
        var strHidIdValue=document.getElementById('<%=hidId.ClientID %>').value;
        var strHidChannelValue=document.getElementById('<%=hidChannel.ClientID %>').value;
        if(strHidIdValue!="" && strHidChannelValue!="")
        {
            var strHidId=strHidIdValue.split(',');
            var strHidChannel=strHidChannelValue.split(',');
            PlayerCount=strHidId.length;
            playId=strHidId;
            playChannel=strHidChannel;
            // 设定播放器数量
            NetClientX.PlayerCount=16;
            // 初始化播放器
		    NetClientX.InitNetClient();	
		    real_PlayStream();
        }
        else
        {
            PlayerCount=0;
            playId=new Array("203.94.8.147");
            alert(playId.length);
            playChannel=new Array("0");
            // 设定播放器数量
            NetClientX.PlayerCount=PlayerCount;
            // 初始化播放器
		    NetClientX.InitNetClient();	
        }
        
        

		
    }
	
	function InitClientX()
	{
		NetClientX.PlayerCount=PlayerCount;
		NetClientX.InitNetClient();	
	}
	function real_PlayStream()
	{	
	var NetClientX = document.getElementById("NetClientX");
		for(i= 0; i<PlayerCount;i++)
		{
		
			NetClientX.SetSinglePlayer(i,playChannel[i],playId[i]);
			NetClientX.real_PlayStream(i);	
		}
	}
	function Stop()
	{
	var NetClientX = document.getElementById("NetClientX");
		for(i= 0; i<PlayerCount;i++)
		{
			NetClientX.Stop(i);
		}
	}


   window.attachEvent("onload", pOnloadFunc);
</Script>
    <table class="table_border_line">
        <tr>
            <td align="left" colspan="2">

                <script language="javascript">
                                (new TitleBar('HealthArchivesMdcSrh', '监控画面')).showBar();
                </script>

            </td>
        </tr>
        <tr>
        <td style="height:25px; text-align:center;" colspan="2">
            <asp:Label ID="lbl" runat="server" Font-Bold="True" Font-Size="11pt"></asp:Label></td>
        </tr>
        <tr>
        <td style="text-align:center; vertical-align:middle;" colspan="2">
        <OBJECT ID="NetClientX" name="NetClientX" CLASSID="CLSID:DF96697B-C91A-4DF6-8EA1-DC0CF61FCF42" align="center" hspace="0" vspace="0" height="550" width="638" VIEWASTEXT>
                </OBJECT>
        </td>
        </tr>
    </table>
    <br />
    <table class="table_border_line">
    <tr>
        <td style="width: 8%; text-align: left">
        </td>
    <td style="text-align:left; width:25%">
    选择区域 <asp:DropDownList ID="DrpGroup" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DrpGroup_SelectedIndexChanged" DataTextField="GroupName" DataValueField="GroupId">
            </asp:DropDownList>
    </td>
    <td style="text-align:center; width:33%">
        <input type="button" name="Submit" value="播放" OnClick="real_PlayStream()">
        <input type="button" name="Submit" value="停止" OnClick="Stop()">
    </td>
    <td style="text-align:center; width:33%"></td>
    </tr>
    </table>
    <asp:HiddenField ID="hidId" runat="server" />
    <asp:HiddenField ID="hidChannel" runat="server" />
</asp:Content>
